package cn.quevo.beetl.spring.boot.autoconfigure;

import org.beetl.core.ResourceLoader;
import org.beetl.core.resource.ClasspathResourceLoader;
import org.springframework.boot.autoconfigure.template.AbstractTemplateViewResolverProperties;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.core.io.Resource;

import cn.quevo.beetl.BeetlRegister;

@ConfigurationProperties(prefix = "spring.beetl")
public class BeetlProperties extends AbstractTemplateViewResolverProperties {

	public static final String DEFAULT_PREFIX = "";

	public static final String DEFAULT_SUFFIX = ".html";

	private Resource configFileResource; // beetl.properties配置文件
	private String root; // root
	private BeetlRegister beetlRegister; // 注册函数
	private ResourceLoader resourceLoader = new ClasspathResourceLoader(); // 类加载器
	private String resourceRoot;

	protected BeetlProperties() {
		super(DEFAULT_PREFIX, DEFAULT_SUFFIX);
	}

	public Resource getConfigFileResource() {
		return configFileResource;
	}

	public void setConfigFileResource(Resource configFileResource) {
		this.configFileResource = configFileResource;
	}

	public String getRoot() {
		return root;
	}

	public void setRoot(String root) {
		this.root = root;
	}

	public BeetlRegister getBeetlRegister() {
		return beetlRegister;
	}

	public void setBeetlRegister(BeetlRegister beetlRegister) {
		this.beetlRegister = beetlRegister;
	}

	public ResourceLoader getResourceLoader() {
		return resourceLoader;
	}

	public void setResourceLoader(ResourceLoader resourceLoader) {
		this.resourceLoader = resourceLoader;
	}

	public String getResourceRoot() {
		return resourceRoot;
	}

	public void setResourceRoot(String resourceRoot) {
		this.resourceRoot = resourceRoot;
	}

}
